<style lang="less">
@import '../../../styles/common.less';
</style>

<template>
  <Card>
    <Row>
      <Tabs v-model="curTab" @on-click="clickTab">
        <TabPane label="行动代码" name="operationAction">
          <operation-action :collectTaskParams='collectTaskParams'></operation-action>
        </TabPane>
         <TabPane label="电催录入" name="operationEntry">
          <operation-entry :collectTaskParams='collectTaskParams'></operation-entry>
        </TabPane>
        <TabPane label="催收外访" name="operationOutbound">
          <operation-outbound :collectTaskParams='collectTaskParams'></operation-outbound>
        </TabPane>
        <TabPane label="操作" name="operationFile">
          <operation-file :collectTaskParams='collectTaskParams'></operation-file>
        </TabPane>
      </Tabs>
    </Row>
  </Card>
</template>

<script>
import operationAction from './collection-operation-action.vue'
import operationEntry from './collection-operation-entry.vue'
import operationOutbound from './collection-operation-outbound.vue'
import operationFile from './collection-operation-file.vue'
export default {
  name: 'collection-deal-compent',
  components: {
    operationAction,
    operationEntry,
    operationOutbound,
    operationFile
  },
  data () {
    return {
      modal1: false,
      modalComptParams: {// 传递给taskDetailComponent的参数对象
        isModal: false,
        curLoanId: ''
      },
      curTab: 'operationAction'
      // collectTaskParams: {// 传递给子tab的参数对象
      //   loanId: '',
      //   overdueCode: '',
      //   overdueCaseId: '',
      //   overdueType: '',
      //   operationAction: false,
      //   operationEntry: false,
      //   operationOutbound: false,
      //   operationFile: false
      // }
    }
  },
  computed: {
    avatorImage () {
      return localStorage.avatorImgPath
    }
  },

  created () {
    // 初始化当前页面请求对象实例
    // this.collectTaskParams.loanId = this.$route.query.loanId
    // this.collectTaskParams.overdueCode = this.$route.query.overdueCode
    // this.collectTaskParams.custCardNo = this.$route.query.custCardNo
    // this.collectTaskParams.overdueCaseId = this.$route.query.overdueCaseId
    // this.collectTashParams.overdueType = this.$route.query.overdueType
    this.initpage()
  },
  methods: {
    openModal: function () {
      this.modal1 = true
      this.modalComptParams.isModal = true
      this.modalComptParams.curLoanId = this.collectTaskParams.loanId
    },
    closeModal () {
      this.modal1 = false
      this.modalComptParams.isModal = false
    },
    // 点击tab事件
    clickTab (tabName) {
      this.collectTaskParams[tabName] = true
    },
    initpage: function () {
      var vm = this
      // 加载默认tab页签数据
      vm.collectTaskParams[this.curTab] = true
    }
  },
  props: {
    collectTaskParams: Object
  }
}
</script>
